package com.lyc.proxy;

import com.seeta.pool.SeetaConfSetting;
import com.seeta.sdk.FaceRecognizer;
import com.seeta.sdk.SeetaImageData;
import com.seeta.sdk.SeetaModelSetting;
import com.seeta.sdk.SeetaPointF;

/**
 * @author Administrator
 * @date 2024/4/28
 * @project hushan-iot-platform
 * @package com.lyc.proxy
 */
public class FaceRecognizerProxy extends com.seeta.proxy.FaceRecognizerProxy {

    private SeetaConfSetting setting;

    public FaceRecognizerProxy(SeetaConfSetting config) {
        super(config);
        this.setting = config;
    }

    @Override
    public float[] extract(SeetaImageData seetaImageData, SeetaPointF[] pointFS) {
        FaceRecognizer faceRecognizer = new FaceRecognizer(setting.getSeetaModelSetting());
        float[] features = new float[faceRecognizer.GetExtractFeatureSize()];
        faceRecognizer.Extract(seetaImageData, pointFS, features);
        faceRecognizer.dispose();
        return features;
    }
}
